var news;
$(function () {
    news = new Vue({
        el:'#newsController',
        data:{
            list:[],
            page:1,
            limit:10,
            busy:false,
            hasMore:true,
        },
        methods:{
            loadData:function () {
                console.log(2)
                var that = this;
                if (!that.hasMore){
                    return;
                }
                that.busy = true;
                sy.postApi('/api/index/informationList',{
                    page:that.page,
                    limit:that.limit
                },function (data) {
                    $.each(data,function(i,o){
                        // o.time = o.createTime.substring(0,16);
                        that.list.push(o);
                    });
                    if(data.length < that.limit){
                        that.hasMore = false;
                    }else{
                        that.busy = false;
                        that.page ++;
                    }
                })
            },
            jump:function (data) {
                // if (data.type == 2){
                //     window.open(data.targetContent);
                // }else{
                //     if (data.redType  == 0){
                //         location.href = sy.path+"/web/artist/"+data.targetContent;
                //     }else{
                //         location.href = sy.path+"/web/art/"+data.targetContent;
                //     }
                //
                // }
                if (data.type == 2){
                    window.open(data.targetContent);
                }else{
                    location.href = sy.path+'/web/index/news/'+data.id;
                }
            }
        },
        created:function () {
            // console.log(1)
            // this.loadData();
        }
    });
})